# -*- coding: utf-8 -*-
# @File:     test_product.py
# @Author:
# @DateTime: 2025/06/17/16:11
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, BASE_DIR)
import settings
import json
import pika

# 1 链接rabbitmq
credentials = pika.PlainCredentials(settings.QUEUE_USER, settings.QUEUE_PWD)
connection = pika.BlockingConnection(pika.ConnectionParameters(settings.QUEUE_HOST, port=settings.QUEUE_PORT, credentials=credentials))
channel = connection.channel()

routing_key = 'test_generate'

send_dict = {

        'user_data': [
            {
                "name": "图片",
                "nodeId": "20",
                "fieldName": "image",
                "fieldValue": 'https://linkdesign-resource.com.cn/generate/300/cloth_img/20250611100445228479240.png',
            },
            {
                "name": "文本描述",
                "nodeId": "21",
                "fieldName": "text",
                "fieldValue": "模特转头，手轻微调整位置，模特看向其他的前方，模特转头，往后稍微退一些，摆出拍照姿势，手部抬起，模特转身，背朝镜头，改变胳膊动作，再摆出拍照姿势，身体轻微转动，转头看向侧面",
            },
            {
                "name": "最大宽度",
                "nodeId": "34",
                "fieldName": "value",
                "fieldValue": '768',
            },
        ],
        'result_node': '11',
        'workflowId': '1934890416552484865',
        'nodeInfoList': [
            {
                "nodeId": "13",
                "fieldName": "seed",
                "fieldValue": '12345',
            },

        ]
    }

channel.basic_publish(exchange='',  # 简单模式
                          routing_key=routing_key,  # 指定队列
                          body=json.dumps(send_dict),
                          properties=pika.BasicProperties(delivery_mode=2, priority=1)
                          )












